fprintf — Formatted output to a file


\begin{rail}
FilePrint : 'fprintf' '(' String ',' String ( ( ',' Variable ) * ) ')' ;
\end{rail}
The fprintf function is intended for writing formatted output to a file. It is similar to the C language function of the same name, though some features are limited or not available, since doesn't have all the data types of C. The first argument is a string which specifies which file the formatted string is to be written to. If this argument starts with |, then the rest of the argument is taken as a process which should be invoked, and the formatted output string is sent to that process. The second string argument is the format string. It consists of the text to be written out, and possibly some conversion specifications. A conversion specification is a sequence of commands that determine how the remainder of the arguments are to be displayed. The left most conversion specifier is matched to the third argument, the next specifier to the fourth argument, and so on. Each argument has to be matched to a conversion specification. When the format string is being scanned, the argument that matches the the specifier that the scanner is up to is called the current argument. Conversion specifications always begin with a +